package com.bjc.platform.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.bjc.platform.model.AdmAuthority;

/**
 * 
 * AdmAuthority Jpa repo接口
 * 
 */
@Transactional(readOnly = true)
public interface AdmAuthorityRepo extends JpaRepository<AdmAuthority, Long> {

	/**
	 * @param roleId
	 */
	@Modifying
	@Transactional(propagation = Propagation.REQUIRED)
	@Query("delete from AdmAuthority u where u.admRole.id = ?1 ")
	public void deleteByRoleId(Long roleId);

}
